package beautiful.butterfly.server.socketserver.pojo;

import java.io.Serializable;


public class Response implements Serializable {
    public static final String ok = "0";
    public static final String error = "1";
    private static final long serialVersionUID = 1L;
    private long id;
    //
    private long mainModuleId;
    private long subModuleId;
    private long createTime;
    //
    private String content = "";
    //
    private String errorCode;
    //
    private String errorMessage;


    public static Response newResponse(Request request) {
        Response response = new Response();
        request.setMainModuleId(request.getMainModuleId());
        request.setSubModuleId(request.getSubModuleId());
        request.setCreateTime(System.currentTimeMillis());
        //not has body
        return response;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getMainModuleId() {
        return mainModuleId;
    }

    public void setMainModuleId(long mainModuleId) {
        this.mainModuleId = mainModuleId;
    }

    public long getSubModuleId() {
        return subModuleId;
    }

    public void setSubModuleId(long subModuleId) {
        this.subModuleId = subModuleId;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    @Override
    public String toString() {
        return "Response{" +
                "id=" + id +
                ", mainModuleId=" + mainModuleId +
                ", subModuleId=" + subModuleId +
                ", createTime=" + createTime +
                ", content='" + content + '\'' +
                ", errorCode='" + errorCode + '\'' +
                ", errorMessage='" + errorMessage + '\'' +
                '}';
    }
}
